﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace PeerApi.Controllers
{

    /// <summary>
    /// 子节点的一些处理
    /// </summary>
    [Route("api/[controller]")]
    public class ValuesController : Controller
    {
        /// <summary>
        /// 验证合约
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public bool Get(string data)
        {
            //序列化data

            //验证身份
            var isok = CheckCA(1);
            if (isok) {
                //合约逻辑  合约逻辑所有的节点通用 需提出

                return true;
            }
            return true;
        }

        /// <summary>
        /// 验证用户权限
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool CheckCA(int id)
        {
            //暂时
            return true;
        }

    }
}
